import Vue from 'vue';
import Vuex from 'vuex';
import createPersistedState from 'vuex-persistedstate'
// import home from './modules/home'
import login from './modules/login'

Vue.use(Vuex);

const store = new Vuex.Store({
    modules:{
        login

    },
    // 全局公用state
    state: {
        //userInfo:{},
        //options:[],
        //selectedId:''
    },
    // 全局公用mutations
    mutations: {
        change(val){
            this.state.selectedId =val;
        }
    },
    // 全局公用actions
    actions: {

    },
    plugins: [createPersistedState()]
  })

export default store;  
//"$store.commit('addOne')

